package com.css.fxfzypg.manage.sampling.service;

import com.css.fxfzypg.base.response.RestResponse;
import com.css.fxfzypg.manage.sampling.repository.entity.SamplingEntity;
import com.css.fxfzypg.manage.sampling.repository.entity.StructureFeature;
import com.css.fxfzypg.manage.sampling.vo.SamplingParams;
import com.css.fxfzypg.manage.sampling.vo.SamplingSurveyPointVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;

public interface SamplingService {

    boolean insertSurvey(SamplingEntity samplingEntity) throws UnsupportedEncodingException;

    Map<String,Object>  querySubmitOrNot(String submitFlag, String taskCode, int curPage, int pageSize, String userId);

    boolean updateIsSubmit(Map<String,String> map);

    SamplingEntity queryData(String id);

    boolean modifyData(SamplingEntity samplingEntity);

    Map<String, Object> querySamplingData(SamplingParams queryParams, int curPage, int pageSize);

    boolean deleteSampling(String ids);

    boolean saveAndSubmit(SamplingEntity samplingEntity) throws UnsupportedEncodingException;

    boolean modifyAndSubmit(SamplingEntity samplingEntity);

    List<SamplingEntity> getDataByUserId(String taskCode, String userId);

    List<SamplingParams> querySamplingMap(SamplingParams queryParams);

    List<SamplingEntity> getSamplingByTaskCode(String taskCode);

    Map<String, Object> uploadSampling(MultipartFile file) throws Exception;

    void exportSampling(HttpServletResponse response, SamplingParams queryParams);

    SamplingEntity getNearestSamplingAPP(String longitude, String latitude, String taskCode);

    List<Map<String, Object>> getFieldSurveyNameByTaskCode(String taskCode);

    boolean saveStructureFeature(StructureFeature structureFeature);

    RestResponse getSamplingSurveyPoint(SamplingSurveyPointVo samplingSurveyPointVo,HttpServletRequest request);

    void savePie(String id,String typePie, String yearsPie);

    List<SamplingEntity> getByTaskCodeAndProvinceId(String xcdcId, String provinceId);

    Integer countByTaskCodeAndProvinceId(String taskNum, String currProvinceId);

    Integer countCommitByTaskCodeAndProvinceId(String taskNum, String currProvinceId);
}
